package org.assocsp3.modele;

import java.util.Set;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;

public class Personne{
     
	 private int id;
     
     @Size(min=1, max=16)
     private String login;

     @Size(min=1, max=64)
     private String nom;
     
     @Size(min=1, max=64)
     private String prenom;
     
     @Email
     @Size(min=1, max=128)
     private String email;
     
     @Size(min=1, max=256)
     private String address;
     
     @Size(min=1, max=128)
     private String mdp;
     
     @Size(min=1, max=128)
     private String validmdp;
     
     @Size(min=1, max=128)
     private String role;

     private boolean actif;
     
     private Set<Paiement> paiements;

    public Personne() {
    }

    public Personne(String nom, String prenom, String email, String address) {
       this.nom = nom;
       this.prenom = prenom;
       this.email = email;
       this.address = address;
    }
    
    public Personne(String login,String mdp) {
		this.login=login;
		this.mdp=mdp;		
	}
    
    public Personne(String login,boolean b) {
		this.login=login;
		this.actif=b;
	}

	public int getId() {
        return this.id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
  
    public String getNom() {
        return this.nom;
    }
    
    public void setNom(String nom) {
        this.nom = nom;
    }
    public String getPrenom() {
        return this.prenom;
    }
    
    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    public String getAddress() {
        return this.address;
    }
    
    public void setAddress(String address) {
        this.address = address;
    }

    public String getLogin() {
        return this.login;
    }
    
    public void setLogin(String login) {
        this.login = login;
    }
    
    public String getMdp() {
        return this.mdp;
    }
    
    public void setMdp(String mdp) {
        this.mdp = mdp;
    }

	public void setValidmdp(String validmdp) {
		this.validmdp = validmdp;
	}

	public String getValidmdp() {
		return validmdp;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getRole() {
		return role;
	}

	public void setActif(boolean actif) {
		this.actif = actif;
	}

	public boolean isActif() {
		return actif;
	}

	public void setPaiements(Set<Paiement> paiements) {
		this.paiements = paiements;
	}

	public Set<Paiement> getPaiements() {
		return paiements;
	}

	public boolean memeMdp() {
		return (mdp.equals(validmdp));
	}

}
